Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MHLO] fix tensor mode aten.div op pattern #1160

Merged
merged 2 commits into from
Aug 6, 2022

Conversation

tanyokwok
Copy link
Collaborator

@tanyokwok tanyokwok commented Aug 5, 2022

See RFC #999

Co-authored-by: Bairen Yi yibairen.byron@bytedance.com
Co-authored-by: Jiawei Wu xremold@gmail.com
Co-authored-by: Tianyou Guo tianyou.gty@alibaba-inc.com
Co-authored-by: Xu Yan yancey.yx@alibaba-inc.com
Co-authored-by: Ziheng Jiang ziheng.jiang@bytedance.com

@tanyokwok
Copy link
Collaborator Author

I added the tensor mode aten.div op pattern; please review for me @silvasean @ZihengJiang @Vremold. Also, I found a bug in the torch.floor_divide decomposition pass and fixed it in this PR @vivekkhandelwal1

@ZihengJiang
Copy link
Collaborator

LGTM!

Tanyo Kwok and others added 2 commits August 6, 2022 23:06
Co-authored-by: Bairen Yi <yibairen.byron@bytedance.com>
Co-authored-by: Jiawei Wu <xremold@gmail.com>
Co-authored-by: Tianyou Guo <tianyou.gty@alibaba-inc.com>
Co-authored-by: Xu Yan <yancey.yx@alibaba-inc.com>
Co-authored-by: Ziheng Jiang <ziheng.jiang@bytedance.com>
@tanyokwok tanyokwok force-pushed the tanyo/fix_torch_floor_divide branch from 2333621 to b8113b3 Compare August 6, 2022 15:14
@tanyokwok tanyokwok merged commit 1ee8659 into llvm:main Aug 6, 2022
@tanyokwok tanyokwok deleted the tanyo/fix_torch_floor_divide branch August 6, 2022 15:38
// to C-style integer division.
auto sign = rewriter.create<mhlo::SignOp>(loc, result);
auto abs = rewriter.create<mhlo::AbsOp>(loc, result);
auto floor = rewriter.create<mhlo::FloorOp>(loc, abs);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mhlo.floor only supports float, so this will rase error when lowering div.Tensor_mode on two integers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants